 <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<script type="text/javascript" charset="UTF-8">
	var menuTree;
	$(function() {
		menuTree = $('#menuTree').tree({
			url : ctx+'/sys/menu/leftMenu.htm?state=A',
			animate : false,
			lines : !sy.isLessThanIe8(),
			onClick : function(node) {
				if (node.attributes && node.attributes.src && node.attributes.src != '') {
					var href;
					if (/^\//.test(node.attributes.src)) {	/*以"/"符号开头的,说明是本项目地址 */
						href ="../"+node.attributes.src.substr(1);
						$.messager.progress({
							text : '请求数据中....',
							interval : 100
						});
					} else {
						href =node.attributes.src;
					}
					addTabFun({
						src : href,
						title : node.text,
						type:node.attributes.type,
						iconCls:node.iconCls
					});
				} else {
					<%--
					addTabFun({
						src : '../../jsp/none.jsp',
						title : '未完成..'
					});
					--%>
				}
			},
			onLoadSuccess : function(node, data) {
				var t = $(this);
				if (data) {
					$(data).each(function(index, d) {
						if (this.state == 'closed') {
							t.tree('expandAll');
						}
					});
				}
			}
		});

	});
	 function showOnlive(){
		 $("#userOnLineGrid").datagrid({
				url : ctx+'/sys/user/getOnline.htm',
				pagination : false,
				fitColumns : true,
				nowrap : false,
				border : false,
				singleSelect:true,
				width:360,
				height:200,
				columns : [ [ 
				{
					field : 'user_name',
					title : '姓名',
					width : 100
					 
				},
				{
					field : 'role_name',
					title : '角色',
					width : 100
					 
				},
				{
					field : 'login_date',
					title : '登录时间',
					width : 150
					 
				}] ]
			});
		 $('#userOnLineDia').show().dialog({
				modal : true,
				title : '在线用户列表',
				buttons : [{
					text : '关闭',
					handler : function() {
						 $('#userOnLineDia').dialog('close');
					}
				} 
				]
			});
	 }
</script>
<div class="easyui-panel" fit="true" border="false">
<div class="easyui-accordion" data-options="fit:true,border:false">
	<div title="系统菜单" data-options="iconCls:'icon-computer',tools : [ {

				iconCls : 'icon-reload',

				handler : function() {

					menuTree.tree('reload');

				}

			}, {

				iconCls : 'icon-redo',

				handler : function() {

					var node = menuTree.tree('getSelected');

					if (node) {

						menuTree.tree('expandAll', node.target);

					} else {

						menuTree.tree('expandAll');

					}

				}

			}, {

				iconCls : 'icon-undo',

				handler : function() {

					var node = menuTree.tree('getSelected');

					if (node) {

						menuTree.tree('collapseAll', node.target);

					} else {

						menuTree.tree('collapseAll');

					}

				}

			} ]">

		<ul id="menuTree" style="margin-top: 5px;"></ul>

	</div>
	<div title="其他" data-options="iconCls:'icon-help'">
		 <a  href="javascript:void(0)" onclick="showOnlive()" >在线用户列表</a>
	</div>
 
</div>	 
</div>